package com.cdqidi.core.weixinmanager.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 人员和微信用户
 *
 * @author sjk
 */
@Getter
@Setter
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("sys_wx_middle_user")
public class MiddleUser extends Model<MiddleUser> implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(value = "r_id", type = IdType.ASSIGN_ID)
    private String rId;
    /**
     * 用户ID
     */
    @TableField("user_id")
    private String userId;
    /**
     * 用户手机号
     */
    @TableField("mobile")
    private String mobile;
    /**
     * 全局唯一编号
     */
    @TableField("union_id")
    private String unionId;
    /**
     * 用户昵称
     */
    @TableField("nick_name")
    private String nickName;
    /**
     * 用户标识:用户的标识，对当前公众号唯一
     */
    @TableField("openid")
    private String openid;
    /**
     * 绑定时间
     */
    @TableField("bind_time")
    private LocalDateTime bindTime;
    /**
     * 用户头像
     */
    @TableField("head_img")
    private String headImg;
    /**
     * 公众号
     */
    @TableField("appid")
    private String appId;

    public void freeData() {
        this.rId = null;
        this.userId = null;
        this.mobile = null;
        this.unionId = null;
        this.nickName = null;
        this.openid = null;
        this.bindTime = null;
        this.headImg = null;
        this.appId = null;
    }

}
